function update() {
	var answerId = $("#answerId").val();
	if(!answerId) {
		parent.layer.msg("请选择竞猜答案");
		return;
	}
	$.ajax({
		cache : true,
		type : "POST",
		url : "/system/guess/setAnswer",
		data : $('#signupForm').serialize(),// 你的formid
		async : false,
		error : function(request) {
			parent.layer.alert("Connection error");
		},
		success : function(data) {
			if (data.code == 0) {
				parent.layer.msg("操作成功");
				parent.reLoad();
				var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
				parent.layer.close(index);

			} else {
				parent.layer.alert(data.msg)
			}

		}
	});

}

//加载已经添加的竞猜项目
loadGuessItem();

function loadGuessItem() {
	var id = $("#id").val();
	$.ajax({//发送AJAX请求
		type : "POST",
		url : "/system/guess/loadGuessItem?guessId="+id,
		success : function(data) {
			var html = '';
			html += '<option value="">'+"请选择"+'</option>';
			if(data != null && data != '') {
				data = data.data;
				$.each(data, function() {
					html += '<option value="'+this.id+'">'+this.guessName+'</option>';
				});
			}
			$("#answerId").html(html);
		}
	});
}